package com.codeczx.myretrofitdemo.retrofit;

import java.io.IOException;

import okhttp3.ResponseBody;
import okio.Buffer;

/**
 * Created by codeczx on 2018/3/29.
 */

public class Utils {

    static ResponseBody buffer(final ResponseBody body) throws IOException {
        Buffer buffer = new Buffer();
        body.source().readAll(buffer);
        return ResponseBody.create(body.contentType(),body.contentLength(),buffer);
    }
}
